//logs.js
const app = getApp()
var module=require("../../utils/youwan.js");

Page({
  data: {
  	language:'',
  },
  onLoad: function () {
    var lang = app.globalData.lang;
    if (lang != "zh") {
      wx.setNavigationBarTitle({
        title: 'Shopping'
      })
    }
    this.setData({
      language:app.globalData.lang
    });
  },
tap:function(e){
    const type=e.currentTarget.dataset.type;
    var title = '';
    switch(type){
      case 'market': { var url = this.data.language == 'zh' ? 'https://jbh.meituan.com/cn/pages/shop.html' : 'https://jbh.meituan.com/en/pages/shop.html';
        title = this.data.language == 'zh' ? '寻找热门商场中' : '寻找热门商场中';
       } break;
      case 'laozihao': {
        var url = this.data.language == 'zh' ? 'https://jbh.meituan.com/cn/pages/brand.html' : 'https://jbh.meituan.com/en/pages/brand.html';
        title = this.data.language == 'zh' ? '寻找上海老字号' : '寻找上海老字号';
        }break;
    }
  // if (type =='market')
  //   {
  //     wx.showToast({
  //       title: '此功能暂未开放，请持续关注！',
  //       icon: 'none',
  //       duration: 2000
  //     });
  //   }else if(type=='laozihao'){
      wx.navigateTo({
      url:'/pages/h5/index?url='+url+'&title='+title
    })
    // }
  
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    var that = this;
    return {
      title: app.globalData.shareTitle,
      path: app.globalData.sharePath,
      imageUrl: '../../../../images/share_img.png',
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
})